sfeedpath="./.sfeed/feeds"

# use sfeed_ass scripts when uris contain the extension .ass
parse() {
	case $2 in
		# sfeed_ass.sh can be used in place of sfeed_ass_import "$2" | sort -r
		*.ass)	sfeed_ass_import "$2" | sort -r ;;
		*)	sfeed "$2"
	esac
}

# override default client (curl) with ftp from OpenBSD base.
# fetch(name, uri, feedfile)
fetch() {
	ftp -M -V -w 15 -o - "$2"
}

# list of feeds to fetch:
feeds() {
	# feed <name> <feedurl> [basesiteurl] [encoding]
	feed "zvava" "https://zvava.org/feed.ass" "https://zvava.org"
	feed "kindrobot" "https://tilde.town/~kindrobot/feed.ass" "https://tilde.town/~kindrobot"
	feed "opfez" "https://tilde.town/~opfez/blog_ass.ass" "https://tilde.town/~opfez"
	feed "undeadly" "https://undeadly.org/cgi?action=rss"
	feed "xkcd" "https://xkcd.com/atom.xml" "https://xkcd.com"
	feed "FreeBSD news" "https://www.freebsd.org/news/rss.xml" "" "iso-8859-1"
	feed "DragonflyBSD digest" "https://www.dragonflydigest.com/feed"
	feed "NetBSD changes" "https://www.netbsd.org/changes/rss-netbsd.xml"
	# get youtube Atom feed: curl -s -L 'https://www.youtube.com/user/gocoding/videos' | sfeed_web | cut -f 1
	feed "youtube golang" "https://www.youtube.com/feeds/videos.xml?channel_id=UCO3LEtymiLrgvpb59cNsb8A"
}
